﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Copad.BusinessCard.DAL;
using Copad.BusinessCard.Model;
using System.Net;

namespace Copad.BusinessCard.BLL
{
    public class LogBLL : BLL<Log>
    {


        public List<Log> GetLogs(int pageIndex, int pageSize, out int recordCount)
        {
            Func<Log, DateTime> method = (Log x) => x.LogTime;

            return entities.GetPagedEntities<Log, DateTime>(pageIndex, pageSize, out recordCount, method, false).ToList();
        }

        public void Delete(List<long> idList)
        {
            var list = entities.Loges.Where(x => idList.Contains(x.ID)).ToList();
            list.ForEach(x =>
            {
                entities.Loges.Remove(x);
            });
            entities.SaveChanges();
        }
    }
}
